export default {
  methods: {
    async onRenewal (code, overTime = false) {
      try {
        this.renewalLoading = true
        const { renewal } = this.$interface.pay
        const params = {
          configCode: code,
          configName: '',
          overTime,
          theTrialDays: 14
        }
        const { data: response } = await renewal(params)
        if (response.code !== 0) {
          throw response.msg
        }
        if (this.$parent.$parent && this.$parent.$parent.query) {
          this.$parent.$parent.query()
        }
      } catch (error) {
        this.$message.error(error)
      } finally {
        this.renewalLoading = false
      }
    }

  }
}
